package day03;


import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

import org.junit.Test;

/**
 * 输入某人生日，格式为"yyyy-MM-dd"，输出到现在为止经过了多少周。
 * @author Bonnie
 *
 */
public class Test03 {
	@Test
	public void t1() throws ParseException{
		System.out.println("请输入你生日:yyyy-MM-dd");
		Scanner sc=new Scanner(System.in);
		DateFormat d=new SimpleDateFormat("yyyy-MM-dd");
		StringBuilder bd=new StringBuilder();
		bd.append(sc.next());
		Date date=d.parse(bd.toString());
		Date now=new Date();
		long cha=now.getTime()-date.getTime();
		long aaa=cha/1000/60/60/24/7;
		System.out.println(aaa);		
	}
	

}

